package com.jlcindia.dao;

import com.jlcindia.hibernate.Customer;
import com.jlcindia.util.JPATemplate;

public class JPACustomerDAO implements CustomerDAO {

	@Override
	public void addCustomer(Customer cust) {
		JPATemplate.save(cust);
	}

	@Override
	public void updateCustomer(Customer cust) {
		JPATemplate.update(cust);
	}

	@Override
	public void deleteCustomer(int cid) {
		JPATemplate.delete(Customer.class, cid);
		
	}

	@Override
	public Customer getCustomerByCid(int cid) {
		return (Customer)JPATemplate.load(Customer.class, cid);
	}

}
